package com.lanswon.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.lanswon.common.enums.AnnouncementType;
import com.lanswon.common.enums.ArticleStatus;
import com.lanswon.common.enums.ArticleType;

/**
 * @author Administrator
 *
 */
public class ArticleVO {
    private Long articleId;

    private String articleName;

    private Date releaseTime;
    
    private String releaseTimeStr;

    private Integer readNum;

    private Date createTime;

    private Date updateTime;

    private String content;
    
    private Integer articleType;
    
    @SuppressWarnings("unused")
	private String typeStr;
    
    private Integer articleStatus;
    
    @SuppressWarnings("unused")
	private String articleStatusStr;
    
    private Integer announcementType;
    
    private String announcementTypeStr;
    
    private String logoUrl;
    
    
    
    

    public String getAnnouncementTypeStr() {
		return announcementTypeStr = AnnouncementType.getValueByCode(this.announcementType);
	}

	public void setAnnouncementTypeStr(String announcementTypeStr) {
		this.announcementTypeStr = announcementTypeStr;
	}

	public Integer getAnnouncementType() {
		return announcementType;
	}

	public void setAnnouncementType(Integer announcementType) {
		this.announcementType = announcementType;
	}

	public String getLogoUrl() {
		return logoUrl;
	}

	public void setLogoUrl(String logoUrl) {
		this.logoUrl = logoUrl;
	}

	public Long getArticleId() {
        return articleId;
    }

    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }

    public String getArticleName() {
        return articleName;
    }

    public void setArticleName(String articleName) {
        this.articleName = articleName == null ? null : articleName.trim();
    }

    public Date getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(Date releaseTime) {
        this.releaseTime = releaseTime;
    }

    public String getReleaseTimeStr() {
    	if(this.releaseTimeStr==null) {
    		releaseTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(this.getReleaseTime());
    	}else {
    		releaseTimeStr = this.releaseTimeStr;
    	}
		return releaseTimeStr;
	}

	public void setReleaseTimeStr() {
		
	}

	public Integer getReadNum() {
        return readNum;
    }

    public void setReadNum(Integer readNum) {
        this.readNum = readNum;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

	

	public Integer getArticleType() {
		return articleType;
	}

	public void setArticleType(Integer articleType) {
		this.articleType = articleType;
	}

	public String getTypeStr() {
		return typeStr = ArticleType.getValueByCode(articleType);
	}

	public void setTypeStr(String typeStr) {
		this.typeStr = typeStr;
	}

	public void setReleaseTimeStr(String releaseTimeStr) {
		this.releaseTimeStr = releaseTimeStr;
	}

	public Integer getArticleStatus() {
		return articleStatus;
	}

	public void setArticleStatus(Integer articleStatus) {
		this.articleStatus = articleStatus;
	}

	public String getArticleStatusStr() {
		return articleStatusStr = ArticleStatus.getValueByCode(this.getArticleStatus());
	}

	public void setArticleStatusStr(String articleStatusStr) {
		this.articleStatusStr = articleStatusStr;
	}

	@Override
	public String toString() {
		return "ArticleVO [articleId=" + articleId + ", articleName=" + articleName + ", releaseTime=" + releaseTime
				+ ", readNum=" + readNum + ", createTime=" + createTime + ", updateTime=" + updateTime + ", content="
				+ content + ", articleType=" + articleType + ", articleStatus=" + articleStatus + "]";
	}
    
	
    
}